package com.tanhua.model.vo;

import cn.hutool.core.util.RandomUtil;
import com.tanhua.model.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class FansVo implements Serializable {
    private Long id; //用户id
    private String nickname; //昵称
    private String avatar; //用户头像
    private String gender; //性别
    private Integer age; //年龄
    private String city; //城市
    private String education; //学历
    private Integer marriage; //婚姻状态（0未婚，1已婚）
    private Boolean alreadyLove; // 是否喜欢
    private Integer matchRate; //匹配度

    public static FansVo init(UserInfo userInfo){
        FansVo fansVo = new FansVo();
        BeanUtils.copyProperties(userInfo,fansVo);
        fansVo.setMatchRate(RandomUtil.randomInt(30,99));
        return fansVo;
    }
}
